<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class CommonFormRequest extends BaseFormRequest
{

    public function rules()
    {
        return [
            'title'=>'required|string',
            'content'=>'required|string',
            'type'=>'required|numeric|in:1,2',
            'files'=>'sometimes|nullable|array',
            'uid'=>'required|numeric'
        ];
    }

    public function messages()
    {
        return [
            'title.required'=>'标题不能为空',
            'content.required'=>'内容不能为空',
            'type.required'=>'类型不能为空',
        ];
    }
}
